//
// Created by Administrator on 2024/10/21.
//

#ifndef COMMON_HPP
#define COMMON_HPP

#include <chrono>
#include <functional>

#define TIME_TO_KEPPALIVE std::chrono::seconds(10)
#define TIME_TO_DISCONNECT std::chrono::seconds(20)
#define MAX_RETRANSFER_COUNT 3
#define BASIC_RETRANSFER_TIME 2

template <class Container, class Session>
using sender_type = std::function<void(std::shared_ptr<Container>, std::shared_ptr<Session>)>;


namespace network {

enum class notify_type {
    connect,
    disconnect,
    verified
};

template <typename... Args>
using notifier_type = std::function<bool(notify_type, Args... args)>;


// bool parallel_or(std::function<bool()> task1, std::function<bool()> task2) {
//     std::thread t(task1);
// }

}

#endif //COMMON_HPP
